//
//  WithdrawalVC.m
//  ManageMoney
//
//  Created by 大明 on 16/4/28.
//  Copyright © 2016年 db. All rights reserved.
//

#import "WithdrawalVC.h"
#import "DCPaymentView.h"
@interface WithdrawalVC ()
@property (weak, nonatomic) IBOutlet UILabel *cardIdLabel;
@property (weak, nonatomic) IBOutlet UITextField *moneyTextfield;

@end

@implementation WithdrawalVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"提现";
}

- (IBAction)ConfirmThePaymentClick:(id)sender {
    
    
    if ([_moneyTextfield.text.trim isEqualToString:@""]) {
        [SVProgressHUD showErrorWithStatus:@"金额不能为空"];
        return;
    }
    
    DCPaymentView *payAlert = [[DCPaymentView alloc]init];
    payAlert.title = @"请输入支付密码";
    payAlert.detail = @"提现";
    payAlert.amount= [_moneyTextfield.text doubleValue];
    [payAlert show];
    payAlert.completeHandle = ^(NSString *inputPwd) {
        [SVProgressHUD show];
        NSDictionary *pramas  = [[NSDictionary alloc]init];
            pramas = @{@"customerNum":CheckNull(UserInfo[@"NUMBER"]),@"channelNum":_WithdrawalStr,@"cashAmt":_moneyTextfield.text,@"password":inputPwd};
        
        
        NSString *requestRegisterMessageUrl = [@"" stringByAppendingFormat:@"%@%@",hrtxUrl,@"fund/cash.do"];
        [HWHttpTool post:requestRegisterMessageUrl params:pramas success:^(id json) {
            [SVProgressHUD dismiss];
            NSDictionary *dic = json;
            if ([dic[@"responseCode"] intValue] == 200) {
                
                [self leftBarButtonClick:nil];
                
            }else
            {
                [SVProgressHUD showErrorWithStatus:dic[@"responseMessage"]];
            }
        } failure:^(NSError *error) {
            NSLog(@"%@",error);
            [SVProgressHUD dismiss];
        }];
    };
    
    
    

}


@end
